//////////////////////////////////////////////////////////////////
//
// Cities.cs
//
// Copyright (c) 2012 Dan Pike. All rights reserved
//
// Refer to license.txt for any license restrictions.
// 
using Logger4Net;
using System.Configuration;

namespace Entities.Archive
{
   [ConfigurationCollection(typeof(Cities), AddItemName = "city", CollectionType = ConfigurationElementCollectionType.BasicMap)]
   public class Cities : Utilities.ArchiveCollection<City>
   {
      //////////////////////////////////////////////////////////////////////////
      //
      public Cities()
      {
      }

      //////////////////////////////////////////////////////////////////////////
      //
      protected override ConfigurationElement create(string key)
      {
         City element = new City();
         element.name = key;
         return element;
      }

      protected override object GetElementKey(ConfigurationElement element)
      {
         return (element as City).name;
      }

      //////////////////////////////////////////////////////////////////////////
      //
      protected override string ElementName
      {
         get { return "city"; }
      }
   }
}
